package com.hello.system.service.impl;

import java.util.List;
import com.hello.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hello.system.mapper.RentalPaymentsMapper;
import com.hello.system.domain.RentalPayments;
import com.hello.system.service.IRentalPaymentsService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * 支付记录Service业务层处理
 * 
 * @author hello
 * @date 2025-07-20
 */
@Slf4j
@Service
@RequiredArgsConstructor
public class RentalPaymentsServiceImpl extends ServiceImpl<RentalPaymentsMapper, RentalPayments> implements IRentalPaymentsService 
{
    private final RentalPaymentsMapper rentalPaymentsMapper;

    /**
     * 查询支付记录
     * 
     * @param paymentId 支付记录主键
     * @return 支付记录
     */
    @Override
    public RentalPayments selectRentalPaymentsByPaymentId(Long paymentId)
    {
        return rentalPaymentsMapper.selectRentalPaymentsByPaymentId(paymentId);
    }

    /**
     * 查询支付记录列表
     * 
     * @param rentalPayments 支付记录
     * @return 支付记录
     */
    @Override
    public List<RentalPayments> selectRentalPaymentsList(RentalPayments rentalPayments)
    {
        return rentalPaymentsMapper.selectRentalPaymentsList(rentalPayments);
    }

    /**
     * 新增支付记录
     * 
     * @param rentalPayments 支付记录
     * @return 结果
     */
    @Override
    public int insertRentalPayments(RentalPayments rentalPayments)
    {
        rentalPayments.setCreateTime(DateUtils.getNowDate());
        return rentalPaymentsMapper.insertRentalPayments(rentalPayments);
    }

    /**
     * 修改支付记录
     * 
     * @param rentalPayments 支付记录
     * @return 结果
     */
    @Override
    public int updateRentalPayments(RentalPayments rentalPayments)
    {
        rentalPayments.setUpdateTime(DateUtils.getNowDate());
        return rentalPaymentsMapper.updateRentalPayments(rentalPayments);
    }


    /**
     * 批量删除支付记录
     * 
     * @param paymentIds 需要删除的支付记录主键
     * @return 结果
     */
    @Override
    public int deleteRentalPaymentsByPaymentIds(Long[] paymentIds)
    {
        return rentalPaymentsMapper.deleteRentalPaymentsByPaymentIds(paymentIds);
    }

    /**
     * 删除支付记录信息
     * 
     * @param paymentId 支付记录主键
     * @return 结果
     */
    @Override
    public int deleteRentalPaymentsByPaymentId(Long paymentId)
    {
        return rentalPaymentsMapper.deleteRentalPaymentsByPaymentId(paymentId);
    }
}
